import { number } from "@intlify/core-base";

export interface ServiceOrderItem {
  address?: string;
  contactsPerson?: string;
  contactsPhone?: string;
  descriptions?: string;
  equipmentId?: string;
  equipmentName?: string;
  equipmentNum?: number;
  expectedTime?: string;
  faultImages?: Array<string | undefined>;
  faultType?: string;
  happenTime?: string;
  installationPosition?: string;
  location?: {
    latitude?: string;
    longitude?: string;
  };
  locations?: {
    latitude?: string;
    longitude?: string;
  };
  projectId?: string;
  projectName?: string;
  region?: string;
  regionId?: string;
  serviceType?: string;
  workOrderType?: string;
  serviceOrderCode?: string;
  serviceId?: string;
  serviceOrderId?: string;
  serviceStateName?: string;
}
export interface ServicePageReq {
  happenTimeEnd: string;
  happenTimeStart: string;
  projectId: string;
  serviceOrderCode: string;
  serviceState: string;
  serviceType: string;
}

export interface ApplyNumItem {
  serviceOrdersCancle?: number;
  serviceOrdersReceived?: number;
  serviceOrdersTotal?: number;
  serviceOrdersWaiting?: number;
  serviceOrdersCreated?: number;
  serviceOrdersCreating?: number;
}

export interface TabItem {
  tabName: string;
  icon?: string;
  key: string;
  style?: any;
}
// {WAITING:待接单;SERVICE:服务中;EVALUATED:待评价;FINISHED:已完成}
export enum ServiceStateMapper {
  WAITING = "待接单",
  SERVICE = "服务中",
  EVALUATED = "待评价",
  FINISHED = "已完成",
  RECEIVED = "已接收",
  CANCEL = "已取消",
}
export enum ServiceState {
  WAITING = "WAITING",
  SERVICE = "SERVICE",
  EVALUATED = "EVALUATED",
  FINISHED = "FINISHED",
}
// {REPAIR:维修;CHECK:检测;MAINTAIN:保养;INSTALL:安装;DEBUG:调试;REFORM:改造}

export enum StateColor {
  WAITING = "error",
  SERVICE = "error",
  EVALUATED = "error",
  FINISHED = "success",
  RECEIVED = "success",
  CANCEL = "default",
}
export enum ServiceType {
  // ALL = "ALL",
  REPAIR = "REPAIR",
  CHECK = "CHECK",
  MAINTAIN = "MAINTAIN",
  INSTALL = "INSTALL",
  DEBUG = "DEBUG",
  REFORM = "REFORM",
}
export enum ServiceOrderCancelType {
  CUSTOMER = "CUSTOMER",
  BUSINESS = "BUSINESS",
}

export interface WorkOrderItem {
  address?: string;
  contactsPerson?: string;
  contactsPhone?: string;
  description?: string;
  equipmentNum?: number;
  faultType?: string;
  equipmentId?: string;
  equipmentName?: string;
  expectedTime?: string;
  faultImages?: Array<string> | string;
  happenTime?: string;
  latitude?: string;
  longitude?: string;
  projectId?: string;
  region?: string;
  regionId?: string;
  serviceId?: string;
  serviceOrderCode?: string;
  workOrderType?: string;
  customerName?: string;
  customerId?: string;
  projectName?: string;
  serviceOrderId?: string;
}

export interface RevokeServiceOrderItem {
  serviceOrderId: string;
}

export interface DispatchWorkOrderItem {
  helperUserId?: Array<string>;
  helperUserIds?: Array<string>;
  operationUserId?: string;
  opinion?: string;
  plannTime?: string;
  workOrderId?: string;
  operationUserName?: string;
  helperUserName?: string | Array<string>;
  workOrdersSaveRequest?: ServiceOrderItem;
}
export interface CancelApplyItem {
  cancelReason?: string;
  cancelReasonType?: string;
  serviceOrderCancelType?: string;
  serviceOrderId?: string;
  workOrderCancelType?: string;
}

export interface ServiceFlowNodes {
  createdOn?: string;
  operatorUserId?: string;
  operatorUserName?: string;
  operatorUserPhone?: string;
  serviceFlowNodeId?: string;
  serviceFlowNodeRecord?: string;
  serviceFlowNodeState?: string;
  serviceFlowNodeStateName?: string;
  serviceOrderId?: string;
}

export interface ServiceApplyInfo {
  workOrderId?: string;
  address?: string;
  applicant?: string;
  applicantPhone?: string;
  applicantUserId?: string;
  cancelTime?: string;
  cancelUserId?: string;
  canceler?: string;
  complaintFlag?: number;
  contactsPerson?: string;
  contactsPhone?: string;
  createdOn?: string;
  descriptions?: string;
  equipmentId?: string;
  equipmentName?: string;
  equipmentNum?: number;
  serviceFlowNode?: string;
  equipmentVo?: {
    brandVo: {
      brandChineseName?: string;
      brandCode?: string;
      brandEnglishName?: string;
      brandId?: string;
      brandLogo?: string;
    };
    descriptions?: string;
    equipmentGroup?: string;
    equipmentGroupId?: string;
    equipmentId?: string;
    equipmentInfo?: {
      equipmentInfoId?: string;
      equipmentPhotos?: string;
      equipmentPhotoList?: string[];
      manufacturer?: string;
      marking?: string;
      nameplateInfos?: Array<NamePlateInfo>;
      transportType?: string;
    };
    equipmentName?: string;
    equipmentNo?: string;
    equipmentTags?: string;
    equipmentType?: string;
    equipmentTypeId?: string;
    firmwareVersion?: string;
    identification?: string;
    location?: string;
    remark?: string;
    softwareVersion?: string;
    serviceFlowNode: string;
  };
  expectedTime?: string;
  faultImages?: [];
  faultType?: string;
  faultTypeName?: string;
  happenTime?: string;
  locations?: {
    latitude?: string;
    longitude?: string;
  };
  projectId?: string;
  projectName?: string;
  region?: string;
  regionId?: string;
  serviceOrderCode?: string;
  serviceOrderId?: string;
  serviceState?: string;
  serviceStateName?: string;
  serviceType?: string;
  serviceTypeName?: string;
}

export interface NamePlateInfo {
  name: string;
  unit: string;
  value: string;
}

export interface DispatchOptions {
  workOrderId: string;
  projectId: string;
}
